{% do script(['app/js/my/course-set-teacher-list/index.js'])  %}
<div class="course-list course-list-new">
    <div class="row test-row">
        {% for courseSet in courseSets %}
            <div class="col-lg-3 col-md-4 col-xs-6">
                <div class="course-item course-sticky-item">
                  {% if courseSet.course is defined %}
                    {% set course = courseSet.course %}
                  {% else %}
                    {% set course = data('PublishedCourseByCourseSet',{ courseSetId: courseSet.id } ) %}
                  {% endif %}
                  {% if is_plugin_installed('Vip') and setting('vip.enabled') and course.vipLevelId|default(0) > 0 %}
                    <span class="tag-vip-free"></span>
                  {% endif %}
                  <div class="course-img">
                    <a {% if ref|default() %} href="{{ path('course_show', {id: courseSet.defaultCourseId,ref:ref}) }}" {% else %} href="{{ path('course_show', {id: courseSet.defaultCourseId}) }}" {% endif %} target="_blank">
                      {% if courseSet.discountId > 0 %}
                        {% if courseSet.discount == 0 %}
                          <!-- 限免 -->
                          <span class="tag-discount free"></span>
                        {% else %}
                          <!-- 折扣 -->
                          <span class="tag-discount"></span>
                        {% endif %}
                      {% endif %}
                      {% if courseSet.serializeMode == 'serialized' %}
                        <span class="tags"><span class="tag-serialing"></span></span>
                      {% elseif courseSet.serializeMode == 'finished' %}
                        <span class="tags"><span class="tag-finished"></span></span>
                      {% endif %}
                      {% if courseSet.type == 'live' %}
                        <span class="tags">
                          <span class="tag-live"></span>
                        </span>
                      {% endif %}
                      {{ lazy_img(filepath(course_set_cover(courseSet, 'large'), 'courseSet.png'), 'img-responsive', courseSet.title) }}
                    </a>
                    {% if courseSet.stickyTime|default('') %}
                      <span class="course-sticky-tag">{{ 'group.thread.stick_label'|trans }}</span>
                    {% endif %}
                    <div class="course-sticky-mask">
                      {% if not  courseSet.stickyTime|default('') %}
                        <button class="course-sticky-btn js-course-sticky" data-url="{{ path('user_course_set_stick', {courseSetId: courseSet.id}) }}" type="button"><i class="es-icon es-icon-sticky"></i>{{ 'thread.stick_btn'|trans }}</button>
                      {% else %}
                        <button class="course-sticky-btn js-course-unsticky" data-url="{{ path('user_course_set_unstick', {courseSetId: courseSet.id}) }}" type="button"><i class="es-icon es-icon-reply course-sticky-btn__icon"></i><span class="cd-ml16">{{ 'thread.stick_cancel_btn'|trans }}</span></button>
                      {% endif %}
                      </div>

                  </div>
                  <div class="course-info">
                    <div class="title">
                      <a class="link-dark" {% if ref|default() %} href="{{ path('course_show', {id: courseSet.defaultCourseId,ref:ref}) }}" {% else %} href="{{ path('course_show', {id: courseSet.defaultCourseId}) }}" {% endif %}
                       target="_blank">
                        {{ courseSet.title|raw|nl2br }}
                      </a>
                    </div>
                    <div class="metas clearfix">
                      {% if setting('course.show_student_num_enabled', '1') == 1  %}
                        <span class="num">
                          {% if setting('course.show_cover_num_mode') == 'studentNum' %}
                            <i class="es-icon es-icon-people"></i>{{ courseSet.studentNum }}
                          {% elseif setting('course.show_cover_num_mode') == 'hitNum' %}
                            <i class="es-icon es-icon-view"></i>{{ courseSet.hitNum }}
                          {% endif %}
                        </span>
                      {% endif %}
                      {% if setting('goods_setting.show_review', '1') == 1 %}
                        <span {% if setting('course.show_student_num_enabled', '1') == 1 %} class="comment" {% endif %}><i class="es-icon es-icon-textsms"></i>{{ courseSet.ratingNum }}</span>
                      {% endif %}
                      {% set course = courseSet.course|default(null) %}
                        {% if course %}
                          {% include 'course/widgets/price.html.twig' with {shows:'price'} %}
                        {% endif %}
                    </div>
                  </div>
                </div>
            </div>
        {% endfor %}
    </div>
</div>